package com.mtq.web.department.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mtq.utils.PageModel;
import com.mtq.utils.ResponseResult;
import com.mtq.web.department.service.DepartmentService;

@Controller
@RequestMapping("departmentHandle")
public class DepartmentController {

	private static final Logger logger = LoggerFactory
			.getLogger(DepartmentController.class);
	@Autowired
	private DepartmentService departmentService;
	
	@RequestMapping("/departmentList")
	@ResponseBody
	public PageModel queryDepartment (PageModel page,String deptName) {
		page.setPageSize(3);
		try {
			departmentService.queryDepartment(page, deptName);
		} catch (Exception e) {
			logger.error("查询部门出错,【错误信息】："+e.getMessage());
			e.printStackTrace();
		}
		return page;
	}
}
